/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "ref_sv_match_sub")
@NamedQueries({
    @NamedQuery(name = "RefShipVisitMatchSub.findAll", query = "SELECT s FROM RefShipVisitMatchSub s")})
public class RefShipVisitMatchSub implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ref_sms_id")
    private Integer refShipVisitMatchSubId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ref_sm_id")
    private RefShipVisitMatch shipVisitMatch;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ref_ss_id")
    private RefShipVisitSub shipVisitSub;
    
    @Embedded
    private InfoAudit infoAudit;
    
    public RefShipVisitMatchSub(){
        
    }

    public Integer getRefShipVisitMatchSubId() {
        return refShipVisitMatchSubId;
    }

    public void setRefShipVisitMatchSubId(Integer refShipVisitMatchSubId) {
        this.refShipVisitMatchSubId = refShipVisitMatchSubId;
    }

    public RefShipVisitMatch getShipVisitMatch() {
        return shipVisitMatch;
    }

    public void setShipVisitMatch(RefShipVisitMatch shipVisitMatch) {
        this.shipVisitMatch = shipVisitMatch;
    }

    public RefShipVisitSub getShipVisitSub() {
        return shipVisitSub;
    }

    public void setShipVisitSub(RefShipVisitSub shipVisitSub) {
        this.shipVisitSub = shipVisitSub;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (refShipVisitMatchSubId != null ? refShipVisitMatchSubId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RefShipVisitMatchSub)) {
            return false;
        }
        RefShipVisitMatchSub other = (RefShipVisitMatchSub) object;
        if ((this.refShipVisitMatchSubId == null && other.refShipVisitMatchSubId != null) || (this.refShipVisitMatchSubId != null && !this.refShipVisitMatchSubId.equals(other.refShipVisitMatchSubId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.RefShipVisitMatchSub[ refShipVisitMatchSubId=" + refShipVisitMatchSubId + " ]";
    }
}
